package ${attach.servicePackage};

import org.springframework.stereotype.Service;
import ${attach.beanPackage}.${pascalName};
import ${attach.daoPackage}.${pascalName}Dao;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
* Service
* ${tableComment} [${tableName}]
* @author Mr.css on 2018-6-20
*/
@Service
public class ${pascalName}Service {

    @Resource
    private ${pascalName}Dao ${camelName}Dao;

    /**
     * 增
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int insert(${pascalName} pojo){
        return ${camelName}Dao.insert(pojo);
    }

    /**
     * 删
     *
     * @param id id
     * @return affected rows
     */
    public int deleteById(String id){
        return ${camelName}Dao.deleteById(id);
    }

    /**
     * 改
     *
     * @param pojo pojo
     * @return affected rows
     */
    public int updateById(${pascalName} pojo) {
        return ${camelName}Dao.updateSampleById(pojo);
    }

    /**
     * 查
     *
     * @param id id
     * @return pojo
     */
    public ${pascalName} queryById(String id){
        return ${camelName}Dao.selectById(id);
    }

    /**
     * 查列表
     *
     * @param params 参数
     * @return list
     */
    public List<${pascalName}> queryList(Map<String, Object> params) {
        return ${camelName}Dao.selectList(params);
    }
}
